// dlg.txt

//MK Edit

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 50;
short i;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "On this remote stretch of bare, icy stone, you find a cluster of crypts. They are old and worn. A few stands of hardy trees grow around them, and their roots are doing the slow work of tearing them apart, but they will still stand for centuries.";
	text2 = "You aren't alone here. There is a group of brigands camped among the crypts. Their guards watch as you approach.";
	text3 = "However, they aren't openly hostile. When they see who you are, they sheathe their weapons. They aren't actively inviting you in, but they don't prevent you from approaching their camp.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "You enter the catacombs under the crypts. The Rokaj have lived in these mountains for all of recorded history, which means that countless generations are buried on this mountain peak.";
	text2 = "Some of the walls and stone monuments are carved with writing in lost languages. Only the finest scholars of Haven or the Erudico might figure out who was left down here.";
	text3 = "You can sense the shades down here. You hear their incoherent whispers in lost languages. You feel their rage. You will never know what combination of natural magic and Ro will causes their dead to be so restless, but it is an occasional problem.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0;
	text1 = "The upper level of the crypt is full of black stone monuments. Each has a dozen small compartments, containing the ashes of the lost. There are a few offerings to the dead still here, kept remarkably preserved by the ice.";
	code =
		sf(this_town,3,1);
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "You peek into one of the nearby jars. It seems empty at first. Then you shine a light down at the bottom. You see a few inches of quicksilver. The builders of these crypts left the precious stuff as an offering to the dead here.";
	text2 = "You can see why the raiders would find it worthwhile to raid this place. The supply of quicksilver won't last forever, but it is a large and valuable hoard.";
	code =
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "The air around you suddenly grows icy cold! You grab at your weapon with fingers that are instantly frostbitten. You raise it just as shades appear all around you.";
	code =
		sf(this_town,5,1);
		
		spawn_creature(5020);
		set_name(5020,"First Guardian");
		spawn_creature(5021);
		set_name(5021,"Second Guardian");
		
		spawn_creature(5000);
		i = random_group_member(0);
		telep_char_to_char(5000,i,1);
		spawn_creature(5001);
		i = random_group_member(0);
		telep_char_to_char(5001,i,1);
		spawn_creature(5002);
		i = random_group_member(0);
		telep_char_to_char(5002,i,1);
		spawn_creature(5003);
		i = random_group_member(0);
		telep_char_to_char(5003,i,1);
		spawn_creature(5004);
		i = random_group_member(0);
		telep_char_to_char(5004,i,1);
		spawn_creature(5005);
		i = random_group_member(0);
		telep_char_to_char(5005,i,1);
		spawn_creature(5006);
		i = random_group_member(0);
		telep_char_to_char(5006,i,1);
		
		force_char_status(30001,0,6);
		if (difficulty() > 1)
			force_char_status(30001,4,6);
		if (difficulty() > 2)
			force_char_status(30001,2,6);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "Once again, the air grows icy cold. This time, you are prepared for the ambush, though it is still vexing how shades can rise out of the stone floor right next to you.";
	code =
		sf(this_town,6,1);

		spawn_creature(5022);
		set_name(5022,"Third Guardian");
		spawn_creature(5023);
		set_name(5023,"Fourth Guardian");
		if (difficulty() > 1) {
			spawn_creature(5024);
			set_name(5024,"Fifth Guardian");
			}
				
		spawn_creature(5007);
		i = random_group_member(0);
		telep_char_to_char(5007,i,1);
		spawn_creature(5008);
		i = random_group_member(0);
		telep_char_to_char(5008,i,1);
		spawn_creature(5009);
		i = random_group_member(0);
		telep_char_to_char(5009,i,1);
		spawn_creature(5010);
		i = random_group_member(0);
		telep_char_to_char(5010,i,1);
		spawn_creature(5011);
		i = random_group_member(0);
		telep_char_to_char(5011,i,1);
		spawn_creature(5012);
		i = random_group_member(0);
		telep_char_to_char(5012,i,1);
		spawn_creature(5013);
		i = random_group_member(0);
		telep_char_to_char(50013,i,1);
		
		force_char_status(30002,0,6);
		if (difficulty() > 1)
			force_char_status(30002,4,6);
		if (difficulty() > 2)
			force_char_status(30002,2,6);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "An icy wind comes howling down the passage. Some shades haven't realized that you have conquered their catacombs. They rise out of the stone, howling for your blood.";
	code =
		sf(this_town,7,1);

		spawn_creature(5014);
		i = random_group_member(0);
		telep_char_to_char(5014,i,1);
		spawn_creature(5015);
		i = random_group_member(0);
		telep_char_to_char(5015,i,1);
		spawn_creature(5016);
		i = random_group_member(0);
		telep_char_to_char(5016,i,1);
		spawn_creature(5017);
		i = random_group_member(0);
		telep_char_to_char(5017,i,1);
		spawn_creature(5018);
		i = random_group_member(0);
		telep_char_to_char(5018,i,1);
		spawn_creature(5019);
		i = random_group_member(0);
		telep_char_to_char(5019,i,1);

		
		force_char_status(30003,0,6);
		if (difficulty() > 1)
			force_char_status(30003,4,6);
		if (difficulty() > 2)
			force_char_status(30003,2,6);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = 1;
	text1 = "Truce.";
	text2 = "Hawk speaks for us.";
	text3 = "We speak to Haven.";
	text4 = "We are peaceful.";
	text5 = "Progress to the fire.";
	action = SPEECH_BUBBLE;
	code =
		cs();
		as(get_ran(1,1,5));
	break;
	
begintalknode;
	tag = 14;
	condition = 1;
	text1 = "The wounded shade steps backward. It sinks into the stone floor, leaving only a faint tracery of ice.";
	code =
		set_dialogue_pic(853); // skeleton
	break;

begintalknode;
	tag = 15;
	condition = 1;
	text1 = "One of the shades stalking you rises up out of the stone again!";
	code =
		set_dialogue_pic(853); // skeleton
	break;

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "The lich of the catacombs collapses into a pile of bones. Its skull opens its mouth. A hideous, deafening scream emerges. It is soon joined by a chorus of howls, coming out of the walls around you. The ground vibrates under your feet.";
	text2 = "Then the sounds fade. The will of the dead has been broken.";
	code =
		set_dialogue_pic(853); // skeleton
	break;

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "The crypt is securely barred from the inside. You won't be able to enter it here.";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "At least one defender of this crypt has the decency to stand out in the open and wait for you. It is an ancient skeleton, recently ascended from one of the burial pits in this tomb.";
	text2 = "It opens its mouth and lets out a long, terrifying screech. Then it advances, eager to purge you from its eternal, miserable home.";
	code =
		set_dialogue_pic(853); // skeleton
	break;

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "__";

//// Raider Hawk

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "The leader of this pack of raiders rises to meet you. They move to make a space for you by their fire. However, they don't talk. At least not for a while.";
	text2 = "After a long silence, with all of you staring into the fire, the man speaks. _I am Raider Hawk, Haven._ You wait for him to say more. You are disappointed.";
	text5 = "Raider Hawk and you stare into the fire. Eventually, you get a bit used to the long silences. Up here among the glaciers, life can move very slowly.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = 11;
	condition = gf(50,12) == 0;
	question = "_You are a raider?_";
	text1 = "_Am. In the old way. Don't want to fight Haven._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Raiders have been hunting me._";
	text1 = "_Yes. Mad raiders. Want war. We are raiders in the old Ro way. Is why we came up here._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(50,12) == 0;
	question = "_What are you doing here?_";
	text1 = "_Private business of our own. Doing no harm._";

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(50,12) == 0 && gf(6,11) == 2;
	question = "_The Chief of [F6] sent me to help you._";
	text1 = "Hawk nods. _Thought as much. Good. We want to do our work. Want to bring up the quicksilver. Need help, though. More here than our little group can fight._";
	code =
		sf(50,12,1);
	break;

begintalknode;
	state = 10;
	nextstate = 12;
	condition = gf(50,12) == 0;
	question = "_You need to move on._";
	text1 = "He shakes his head. _No. Haven knows we are here. Is allowed._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_Do the High Lithans know you are here?_";
	text1 = "_They do. They know Haven knows. Is allowed to be here._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_What if I force you to go?_";
	text1 = "The raiders seem confused. _Haven knows we are here. Specially allowed. Don't know you would attack us._";

begintalknode;
	state = 12;
	nextstate = 13;
	condition = 1;
	question = "_Haven knows you are here?_";
	text1 = "_Indeed yes. Told us not to talk of it. Haven not talking to Haven?_";

begintalknode;
	state = 13;
	nextstate = -1;
	condition = 1;
	question = "_I'm from Haven. You can tell me things._";
	text1 = "There is a long, long pause. Finally, Hawk says, _No. Haven's chief gave us clear words. Talk to chief, not us. If you meet chief, tell chief we need help. Now talking is done._";
	text2 = "You enjoy the raiders' fire a bit more, and then you leave.";
	action = END_TALK;
	
begintalknode;
	state = 10;
	nextstate = 14;
	condition = gf(50,12) > 0;
	question = "_Why are raiders working for Haven?_";
	text1 = "_We are raiders of the old way. Had to quit for a time, because of the madness._";
	
begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_You are traditional raiders?_";
	text1 = "_Rokaj always has raiders. Travel. Steal to live. Keep our clans strong. Good warriors keep us away. The weak can fail._";
	text2 = "_Is our way. Not good for us now._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = 1;
	question = "_Why did you quit raiding?_";
	text1 = "_The madness. The mad raiders of the Low Dhaga. Wage war. Attack [P] of Haven. Soon, raiders hunted down. Best to hide in mountains for a time._";

begintalknode;
	state = 10;
	nextstate = 17;
	condition = gf(50,12) > 0;
	question = "_How did you come to work for Haven?_";
	text1 = "_My idea. Came up high. Looked for work. Heard about this crypt. Took proposal to your chief._";

begintalknode;
	state = 17;
	nextstate = -1;
	condition = 1;
	question = "_And you get quicksilver?_";
	text1 = "_Aye. This is very old crypt. Found big jugs of quicksilver below. Left as offering to dead. Odd, forgotten idea, but good for us. We loot it. Sell to Haven. Good for all, until the ghosts decided to speak up._";

begintalknode;
	state = 10;
	nextstate = 15;
	condition = gf(50,12) == 1;
	question = "_What is the problem here?_";
	text1 = "_Angry ghosts rising up all over High Litha. Big pests. Didn't think they would rise here. Was wrong. Eventually, the anger of the dead came here. Stopped our work._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_Who is buried here?_";
	text1 = "He shrugs. _Who knows? Ro long forgotten. Can't speak. Just angry and mindless. No right to hold this land anymore._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_Why don't you destroy the ghosts?_";
	text1 = "The raiders shudder. Not from the cold. _Raiders are brave. Even raider courage has limits._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_Do the Misttalkers mind you looting these crypts?_";
	text1 = "_No. In return, we control the ghosts. Keeps them from having to do it. Sometimes, we think the ghosts are more trouble than they are worth._";
	text2 = "_Maybe they want us to clear out the crypt. Then they can move new bodies in here._";
	
begintalknode;
	state = 15;
	nextstate = 16;
	condition = 1;
	question = "_Why did work stop?_";
	text1 = "_Ghosts come out of the walls. Attack us. Drive us up and out._";

begintalknode;
	state = 16;
	nextstate = -1;
	condition = 1;
	question = "_How can I help?_";
	text1 = "He points to the southeast crypt. _That is where we enter. Go in. Find ghosts. Destroy them. Don't think you have long to hunt. Ghosts gone, and Haven gets its quicksilver again._";
	text2 = "The raiders nod in unison. Then the conversation is over. After a rest, you, with regret, leave the warmth of the fire.";
	action = END_TALK;
	
begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(50,12) == 1 && gf(50,11) > 0;
	question = "_The spirits have been destroyed._";
	text1 = "_We know. We heard screams. Don't know how Haven can do this work. Haven is ... different. You folk have no sorts of fear._";
	text2 = "_We're true to our word. Soon, we bring up the quicksilver again. That is all._ Then the conversation is over. After a rest, you leave the warmth of the fire.";
	action = END_TALK;

begintalknode;
	state = 10;
	nextstate = -1;
	condition = gf(50,12) > 1;
	question = "_How is work going?_";
	text1 = "_Is going. Slower, because we're always watching for more ghosts. Still, we'll get you what we promised._";
	action = END_TALK;
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				